package com.varian.system.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import com.varian.tool.Func;
import com.varian.tool.enums.BaseEnum;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * @author ben
 * @since 2024/8/28
 */
@Getter
@RequiredArgsConstructor
public enum NoticeStatusEnum implements BaseEnum<NoticeStatusEnum> {

    /**
     * 已过期
     */
    EXPIRED(0),
    /**
     * 未发布
     */
    NOT_PUBLISHED(1),
    /**
     * 已发布
     */
    PUBLISHED(2),
    ;

    @JsonValue
    @EnumValue
    final Integer value;

    @Override
    public NoticeStatusEnum convert(Integer value) {
        return Func.findBaseEnumByValue(values(), value);
    }
}
